<!DOCTYPE html>
<html lang="en">
<head>
	<title>成绩查询</title>
    <meta charset="utf-8">
    <!-- 优先使用 IE 最新版本和 Chrome -->
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/> 
    <!-- 为移动设备添加 viewport -->
    <meta name="viewport" content="initial-scale=1, maximum-scale=3, minimum-scale=1, user-scalable=no">
    <!-- 忽略页面中的数字识别为电话，忽略email识别 -->
    <!-- 启用360浏览器的极速模式(webkit) -->
    <meta name="renderer" content="webkit">
    <!-- 避免IE使用兼容模式 -->
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!-- 不让百度转码 -->
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <meta name="description" content="kygcxx">
    <meta name="author" content="xxf">
    <script src="http://libs.baidu.com/jquery/1.6.4/jquery.min.js"></script>
    <script>
    function sub(){
    	$sname=$("#sname").val();
    	$cname=$("#cname").val();
    	var send=function(){
    		$.post("apps/type/resultQuery/ty/query",{sname:$sname,cname:$cname},function(data){
        		if(data=="[]"){
        			$("#jieguo").html("没有查询到");
        			return;
            	}
				data=eval('(' + data + ')');
				str="";
				for(i=0;i<data.length;i++){
					str+=data[i]['kcname']+":"+data[i]['score']+"<br>"
				}
    			$("#jieguo").html(str);
    		}).error(function(){
    			send();
    		});
    	}
    	send();
    }
    </script>
</head>
<body>
<div>
选择班级：
<select id="cname">
<option>请选择</option>
<?php foreach (xdb::getInstance()->getcol("select cname from temstuclass where status =1") as $c){?>
<option><?php echo $c?></option>
<?php }?>
</select>
<br>
输入姓名：<input id="sname">
<br>
<input type="button" value="查询" onclick="sub()">
</div>
<div id="jieguo"></div>
</body>
</html>